{include file="common/header.tpl"}
<body>
<div id="wrapper">
	{include file="common/toptab.tpl"}

	{* Check which item is currently active and set active tab to it*}
	{if $smarty.get.sub1 eq "customer"}
		{assign var="customer" value="current"}	
	{elseif $smarty.get.sub1 eq "product"}
		{assign var="product" value="current"}
	{elseif $smarty.get.sub1 eq "featured"}
		{assign var="featured" value="current"}
	{elseif $smarty.get.sub1 eq "specials"}
		{assign var="specials" value="current"}
	{elseif $smarty.get.sub1 eq "shippingmethod"}
		{assign var="shippingmethod" value="current"}
	{elseif $smarty.get.sub1 eq "incomingorder"}
		{assign var="incomingorder" value="current"}
    {elseif $smarty.get.sub1 eq "payment_method"}
		{assign var="paymentmethod" value="current"}  
    {elseif $smarty.get.sub1 eq "email_receiver"}
		{assign var="email" value="current"}	        
	{else}
		{assign var="productgroup" value="current"}
	{/if}
	<div id="tabs4">
			<li id="{$productgroup}"><a href="?module=BgcmsWebshop&sub1=productgroup"><span>{TranslateTag}B_LABEL_PRODUCT_GROUP{/TranslateTag}</span></a></li>
			<li id="{$product}"><a href="?module=BgcmsWebshop&sub1=product"><span>{TranslateTag}B_LABEL_PRODUCTS{/TranslateTag}</span></a></li>
			<li id="{$featured}"><a href="?module=BgcmsWebshop&sub1=featured"><span>{TranslateTag}B_LABEL_FEATURED_PRODUCT{/TranslateTag}</span></a></li>
			<li id="{$specials}"><a href="?module=BgcmsWebshop&sub1=specials"><span>{TranslateTag}B_LABEL_SPECIAL_PRODUCT{/TranslateTag}</span></a></li>
			<li id="{$paymentmethod}"><a href="?module=BgcmsWebshop&sub1=payment_method"><span>{TranslateTag}B_LABEL_PAYMENT_METHOD{/TranslateTag}</span></a></li>
			<li id="{$shippingmethod}"><a href="?module=BgcmsWebshop&sub1=shippingmethod"><span>{TranslateTag}B_LABEL_SHIPPING_METHOD{/TranslateTag}</span></a></li>
			<li id="{$settings}"><a href="?module=BgcmsWebshop&sub1=settings"><span>{TranslateTag}B_LABEL_SETTINGS{/TranslateTag}</span></a></li>
			<li id="{$customer}"><a href="?module=BgcmsWebshop&sub1=customer"><span>{TranslateTag}B_LABEL_CUSTOMER{/TranslateTag}</span></a></li>
            <li id="{$email}"><a href="?module=BgcmsWebshop&sub1=email_receiver"><span>{TranslateTag}B_LABEL_EMAIL_RECEIVER{/TranslateTag}</span></a></li>
            <li id="{$incomingorder}"><a href="?module=BgcmsWebshop&sub1=incomingorder"><span>{TranslateTag}B_LABEL_INCOMING_ORDER{/TranslateTag}</span></a></li>
			<div class="clear"></div>
	</div>

{*Check which item is currently active and load correspond template*}
{if $smarty.get.sub1 eq "customer"}
	<script src="../view/admin/js/webshop/customer.js" type="text/javascript"></script>
		{if $smarty.get.act eq "newcustomer"}
			{include file="BgcmsWebshop/Customer/create.tpl"}
		{elseif $smarty.get.act eq "editcustomer"}
			{include file="BgcmsWebshop/Customer/edit.tpl"}
		{else}
			{include file="BgcmsWebshop/Customer/list.tpl"}	
		{/if}  	
	{elseif $smarty.get.sub1 eq "product"}
		<script src="../view/admin/js/webshop/product.js" type="text/javascript"></script>
		{if $smarty.get.act eq "newproduct"}
			{include file="BgcmsWebshop/Product/create.tpl"}
		{elseif $smarty.get.act eq "editproduct"}
			{include file="BgcmsWebshop/Product/edit.tpl"}
		{else}
			{include file="BgcmsWebshop/Product/list.tpl"}
		{/if}
		
	{elseif $smarty.get.sub1 eq "featured"}
		<script src="../view/admin/js/webshop/featured.js" type="text/javascript"></script>
    
		{if $smarty.get.act eq "newfeatured"}
			{include file="BgcmsWebshop/Featured/create.tpl"}
		{elseif $smarty.get.act eq "editfeatured"}
			{include file="BgcmsWebshop/Featured/edit.tpl"}
        {elseif $smarty.get.act eq "position"}
			{include file="BgcmsWebshop/Featured/position.tpl"}	   
		{else}
			{include file="BgcmsWebshop/Featured/list.tpl"}
		{/if}
		
	{elseif $smarty.get.sub1 eq "shippingmethod"}
		<script src="../view/admin/js/webshop/shippingmethod.js" type="text/javascript"></script>
		{if $smarty.get.act eq "newshippingmethod"}
			{include file="BgcmsWebshop/Shippingmethod/create.tpl"}
		{elseif $smarty.get.act eq "editshippingmethod"}
			{include file="BgcmsWebshop/Shippingmethod/edit.tpl"}
		{else}
			{include file="BgcmsWebshop/Shippingmethod/list.tpl"}
		{/if}
		
	{elseif $smarty.get.sub1 eq "specials"}
		<script src="../view/admin/js/webshop/specials.js" type="text/javascript"></script>
        <link rel="stylesheet" href="../view/admin/css/calendar.css" type="text/css" />
		<script type="text/javascript" src="../view/admin/js/calendar/calendar.js"></script>
        <script type="text/javascript" src="../view/admin/js/calendar/calendar-setup.js"></script>
        <script type="text/javascript" src="../view/admin/js/calendar/calendar-en.js"></script>
		{if $smarty.get.act eq "addspecial"}
			{include file="BgcmsWebshop/Special/create.tpl"}
		{elseif $smarty.get.act eq "editspecial"}
			{include file="BgcmsWebshop/Special/edit.tpl"}	
        {elseif $smarty.get.act eq "position"}
			{include file="BgcmsWebshop/Special/position.tpl"}	    
	    {else}   
	    	{include file="BgcmsWebshop/Special/list.tpl"}
	    {/if}
	{elseif $smarty.get.sub1 eq "incomingorder"}
		<script src="../view/admin/js/webshop/incomingorder.js" type="text/javascript"></script>
		{if $smarty.get.act eq "editincomingorder"}
			{include file="BgcmsWebshop/InComingOrder/edit.tpl"}	
	    {else}   
	    	{include file="BgcmsWebshop/InComingOrder/list.tpl"}
	    {/if}
    {elseif $smarty.get.sub1 eq "email_receiver"}
    	<script src="../view/admin/js/webshop/email_receiver.js" type="text/javascript"></script>
    	{include file="BgcmsWebshop/EmailReceiver/list.tpl"}    
	{elseif $smarty.get.sub1 eq "payment_method"}
		<script src="../view/admin/js/webshop/paymentmethod.js" type="text/javascript"></script>
		{if $smarty.get.act eq "addpaymentmethod"}
			{include file="BgcmsWebshop/PaymentMethod/create.tpl"}
		{elseif $smarty.get.act eq "editpaymentmethod"}
			{include file="BgcmsWebshop/PaymentMethod/edit.tpl"}	
	    {else}   
	    	{include file="BgcmsWebshop/PaymentMethod/list.tpl"}
	    {/if}
    {elseif $smarty.get.sub1 eq "settings"}
    	<script src="../view/admin/js/webshop/settings.js" type="text/javascript"></script>
    	{include file="BgcmsWebshop/Settings/edit.tpl"}    
	
    {else}
		
        <script src="../view/admin/js/webshop/productgroup.js" type="text/javascript"></script>
        <script src="../view/admin/js/webshop/product.js" type="text/javascript"></script>
        {if $smarty.get.submod eq "GetProductByPg"}
            {if $smarty.get.act eq "newproduct"}
                {include file="BgcmsWebshop/Product/create.tpl"}
            {elseif $smarty.get.act eq "editproduct"}
                {include file="BgcmsWebshop/Product/edit.tpl"}
            {else}
                {include file="BgcmsWebshop/ProductGroup/products_in_group.tpl"}
            {/if}
        {else}
            {if $smarty.get.act eq "newproductlist"}
                {include file="BgcmsWebshop/ProductGroup/create.tpl"}
            {elseif $smarty.get.act eq "editProductGroup"}
                {include file="BgcmsWebshop/ProductGroup/edit.tpl"}
            {else}
                {include file="BgcmsWebshop/ProductGroup/list.tpl"}
            {/if}
		{/if}	  
{/if}
</div>
</body>
</html>
